package com.xqzgj.bill.service.impl;

import java.util.List;
import com.xqzgj.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xqzgj.bill.mapper.IncomeMapper;
import com.xqzgj.bill.domain.Income;
import com.xqzgj.bill.service.IIncomeService;

/**
 * 收入记录Service业务层处理
 * 
 * @author zhoujiam
 * @date 2025-03-30
 */
@Service
public class IncomeServiceImpl implements IIncomeService 
{
    @Autowired
    private IncomeMapper incomeMapper;

    /**
     * 查询收入记录
     * 
     * @param incomeId 收入记录主键
     * @return 收入记录
     */
    @Override
    public Income selectIncomeByIncomeId(Long incomeId)
    {
        return incomeMapper.selectIncomeByIncomeId(incomeId);
    }

    /**
     * 查询收入记录列表
     * 
     * @param income 收入记录
     * @return 收入记录
     */
    @Override
    public List<Income> selectIncomeList(Income income)
    {
        return incomeMapper.selectIncomeList(income);
    }

    /**
     * 新增收入记录
     * 
     * @param income 收入记录
     * @return 结果
     */
    @Override
    public int insertIncome(Income income)
    {
        income.setCreateTime(DateUtils.getNowDate());
        return incomeMapper.insertIncome(income);
    }

    /**
     * 修改收入记录
     * 
     * @param income 收入记录
     * @return 结果
     */
    @Override
    public int updateIncome(Income income)
    {
        income.setUpdateTime(DateUtils.getNowDate());
        return incomeMapper.updateIncome(income);
    }

    /**
     * 批量删除收入记录
     * 
     * @param incomeIds 需要删除的收入记录主键
     * @return 结果
     */
    @Override
    public int deleteIncomeByIncomeIds(Long[] incomeIds)
    {
        return incomeMapper.deleteIncomeByIncomeIds(incomeIds);
    }

    /**
     * 删除收入记录信息
     * 
     * @param incomeId 收入记录主键
     * @return 结果
     */
    @Override
    public int deleteIncomeByIncomeId(Long incomeId)
    {
        return incomeMapper.deleteIncomeByIncomeId(incomeId);
    }
}
